
const observer = new PerformanceObserver(list => {
  for (const entry of list.getEntries()) {
    console.log(entry)
    console.log(entry.name + '执行时间：', entry.startTime + entry.duration)
  }
})

// js执行超过50ms 才会触发longtask
observer.observe({ entryTypes: ['longtask'] })